﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace zjxj_repair.Mapper
{
    public static class MappingTable
    {
        /// <summary>
        /// 根据钉号获取工具名称
        /// </summary>
        /// <param name="pointName"></param>
        public static string GetToolNameByPointName(string? pointName)
        {
            if (string.IsNullOrEmpty(pointName))
            {
                return "空";
            }

            string[] pns = pointName.Split("-");

            if (pns[1].Contains("Q"))
            {
                return "拧紧";
            }

            switch (pns[1])
            {
                case "LAD":
                    break;
                case "W01":
                    break;
                case "CXLM":
                    break;
                case "LMLM":
                    break;
                default:
                    break;
            }

            if (pns[1].Equals("LAD"))
            {
                return "抽芯拉铆";
            }else if (pns[1].Contains("Q"))
            {
                return "拧紧";
            }else if (pns[1].Equals("W01"))
            {
                return "抽芯拉铆";
            }else if (pns[1].Equals("CXLM"))
            {
                return "抽芯拉铆";
            }
            else if (pns[1].Equals("LMLM"))
            {
                return "拉铆";
            }
            else
            {
                return "拧紧";
            }
        }

        /// <summary>
        /// 根据ToolName获取ToolButtonName
        /// </summary>
        /// <param name="toolName"></param>
        /// <returns></returns>
        public static string GetToolButtonName(string toolName)
        {
            Dictionary<string, string> dic = new Dictionary<string, string>
            {
                { "拉铆1","LM1"},
                { "拉铆2","LM2"},
                { "抽芯拉铆1","CXLM1"},
                { "抽芯拉铆2","CXLM2"},
                { "拧紧1","MT1"},
                { "拧紧2","MT2"},
            };

            return dic[toolName];
        }

        public static List<string> GetGP12()
        {
            List<string> list = new List<string>()
            {
                "OP20L-R10-01",
                "OP20L-R10-02",
                "OP20L-R10-03",
                "OP20L-R10-04",
                "OP20L-R10-05",
                "OP20L-R10-06",
                "OP20L-R10-07",
                "OP20L-R11-01",
                "OP20L-R11-02",
                "OP20L-R11-03",
                "OP20L-R11-04",
                "OP20L-R11-05",
                "OP20L-R11-06",
                "OP20L-R11-07",
                "OP30L-R13-01",
                "OP30L-R13-02",
                "OP30L-R13-03",
                "OP30L-R13-04",
                "OP30L-R13-05",
                "OP30L-R13-06",
                "OP30L-R13-07",
                "OP30L-R14-01",
                "OP30L-R14-02",
                "OP30L-R14-03",
                "OP30L-R14-04",
                "OP30L-R14-05",
                "OP30L-R14-06",
                "OP30L-R14-07",
                "OP40L-LAD-89443411-1",
                "OP40L-LAD-89443411-2",
                "OP40L-LAD-89443411-3",
                "OP40L-LAD-89443411-4",
                "OP40L-LAD-89443411-5",
                "OP40L-LAD-89443411-6",
                "OP40L-R16-01",
                "OP40L-R16-02",
                "OP40L-R16-03",
                "OP40L-R16-04",
                "OP40L-R16-05",
                "OP40L-R16-06",
                "OP40L-R17-01",
                "OP40L-R17-02",
                "OP40L-R17-03",
                "OP40L-R17-04",
                "OP40L-R17-05",
                "OP40L-R17-06",
                "OP50L-Q1860825TF61-1",
                "OP50L-Q1860825TF61-2",
                "OP60L-R21-01",
                "OP60L-R21-02",
                "OP60L-R21-03",
                "OP60L-R21-04",
                "OP60L-R21-05",
                "OP60L-R21-06",
                "OP60L-R22-01",
                "OP60L-R22-02",
                "OP60L-R22-03",
                "OP60L-R22-04",
                "OP60L-R22-05",
                "OP60L-R22-06",
                "OP60L-R22-07",
                "OP60L-W01-89440645-1",
                "OP60L-W01-89440645-2",
                "OP60L-W01-89440645-3",
                "OP60L-W01-89440645-4",
                "OP70L-Q1861020TF61-1",
                "OP70L-Q1861020TF61-2",
                "OP70L-Q1861020TF61-3",
                "S02L-CXLM-8-01",
                "S02L-CXLM-8-02",
                "S02L-CXLM-8-03",
                "S02L-CXLM-8-04",
                "S02L-CXLM-8-05",
                "S02L-CXLM-8-06",
                "S02L-CXLM-8-07",
                "S02L-CXLM-8-08",
                "S03L-CXLM-7-01",
                "S03L-CXLM-7-02",
                "S03L-CXLM-7-03",
                "S03L-CXLM-7-04",
                "S03L-CXLM-7-05",
                "S03L-CXLM-7-06",
                "S03L-CXLM-7-07",
                "S04L-CXLM-9-01",
                "S04L-CXLM-9-02",
                "S04L-CXLM-9-03",
                "S04L-CXLM-9-04",
                "S04L-CXLM-9-05",
                "S04L-CXLM-9-06",
                "S04L-CXLM-9-07",
                "S04L-CXLM-9-08",
                "S04L-CXLM-9-09",
                "S04L-CXLM-9-10",
                "S05L-CXLM-5-01",
                "S05L-CXLM-5-02",
                "S05L-CXLM-5-03",
                "S05L-CXLM-5-04",
                "S05L-CXLM-5-05",
                "S05L-CXLM-5-06",
                "S05L-LMLM-2-01",
                "S05L-LMLM-2-02",
                "S06L-CXLM-4-01",
                "S06L-CXLM-4-02",
                "S06L-CXLM-4-03",
                "S06L-CXLM-4-04",
                "S06L-LMLM-2-01",
                "S06L-LMLM-2-02",
            };

            return list;
        }
    }
}
